package net.dfrz.oa.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import sun.misc.BASE64Encoder;

/**
 * MD5加密工具类
 * @author vovh
 *
 */
public class MD5Utils {
	public static String md5(String password){
		MessageDigest md5;
		try {
			md5 = MessageDigest.getInstance("md5"); 
			byte[] md = md5.digest(password.getBytes());
			//使用明文编码
			BASE64Encoder encoder=new BASE64Encoder();
			return encoder.encode(md);
		} catch (NoSuchAlgorithmException e) {
		}
		return null;
	}
}
